﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Telerik.Web.UI;
using KPIS.GERP.GIMS.BLL;
using KPIS.GERP.GIMS.IBLL;
using KPIS.GERP.GIMS.MODEL;

namespace KPIS.GERP.GIMS.APP.APP_UI.UserControl
{
    public partial class ICM_PPR_RouteHistoryInform : System.Web.UI.UserControl
    {
        ProgressPrePurchaseRequestBLL bllPpr = new ProgressPrePurchaseRequestBLL();

        protected void Page_Load(object sender, EventArgs e)
        {
            int seq = Convert.ToInt32(Session["HisSeq"].ToString());
            LoadGridInformHistory(seq);
        }

        protected void LoadGridInformHistory(int seq)
        {
            IList<PrePurchaseRequestRouteHistoryInfo> InfoPprRouteHisList = bllPpr.GetPrePurchaseRequestInformHistory(seq);
            GridGroupByExpression g;
            GridInformHis.DataSource = InfoPprRouteHisList;
            GridInformHis.MasterTableView.GroupByExpressions.Clear();
            g = new GridGroupByExpression(GridInformHis.Columns[0]);
            GridInformHis.MasterTableView.GroupByExpressions.Add(g);

            GridInformHis.Columns[0].Visible = false;
            GridInformHis.DataBind();
        }

        protected void GridInformHis_ItemCommand(object source, GridCommandEventArgs e)
        {
            int seq = Convert.ToInt32(Session["HisSeq"].ToString());
            LoadGridInformHistory(seq);
        }
    }
}